//
//  AboutUsViewController.m
//  Cooking
//
//  Created by ZhiPeng.Y on 15/9/9.
//  Copyright (c) 2015年 ZP.Y. All rights reserved.
//

#import "AboutUsViewController.h"
#import "AppMacro.h"
@interface AboutUsViewController ()

@end

@implementation AboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.translucent = NO;
    self.view.backgroundColor = [UIColor colorWithRed:250 / 255.0 green:242 / 255.0 blue:230 / 255.0 alpha:1];
    self.navigationItem.title = @"关于我们";
    
    //左返回键
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"iconfont-fanhuianniu"] style:UIBarButtonItemStyleDone target:self action:@selector(leftButtonAction:)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
    [self createView];
}

#pragma mark -
#pragma mark 左侧返回键
- (void)leftButtonAction:(id)sender {
    [self.navigationController popToRootViewControllerAnimated:YES];
}


- (void)createView {
    UIImageView *logoImage = [[UIImageView alloc] initWithFrame:CGRectMake((WIDTH - 100 / 375.0 * WIDTH) / 2, 35 / 667.0 * HEIGHT, 100 / 375.0 * WIDTH, 100 / 375.0 * WIDTH)];
    NSLog(@"%@", logoImage);
    logoImage.image = [UIImage imageNamed:@"logo.png"];
    logoImage.layer.cornerRadius = 100 / 375.0 * WIDTH / 4;
    logoImage.layer.masksToBounds = YES;
    [self.view addSubview:logoImage];
    [logoImage release];
    
    UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake((WIDTH - 100) / 2, logoImage.frame.origin.y + logoImage.frame.size.height + 5, 100, 20)];
    nameLabel.text = @"爱烹饪";
    nameLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
    nameLabel.textAlignment = NSTextAlignmentCenter;
//    nameLabel.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:nameLabel];
    [nameLabel release];
    
    UILabel *versionsLabel = [[UILabel alloc] initWithFrame:CGRectMake((WIDTH - 150) / 2, nameLabel.frame.origin.y + nameLabel.frame.size.height + 5, 150, 20)];
    versionsLabel.text = @"iCook v1.0";
    versionsLabel.textAlignment = NSTextAlignmentCenter;
//    versionsLabel.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:versionsLabel];
    [versionsLabel release];
    
    UILabel *introduceLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, versionsLabel.frame.origin.y + versionsLabel.frame.size.height + 20 / 667.0 * HEIGHT, WIDTH - 20, 90)];
    introduceLabel.text = @"    爱烹饪是一款以烹饪教学为主题的软件,针对不同适用人群,推荐精选菜肴,包含各式美食,学做菜,就是这么简单,本产品仅供技术交流,不作为任何商业用途.";
    introduceLabel.numberOfLines = 0;
    [self.view addSubview:introduceLabel];
    [introduceLabel release];
    
    UILabel *peopleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, introduceLabel.frame.origin.y + introduceLabel.frame.size.height + 10 / 667.0 * HEIGHT, WIDTH - 20, 20)];
    peopleLabel.text = @"开发人员: ZhiPeng.Y";
    [self.view addSubview:peopleLabel];
    [peopleLabel release];
    
    UILabel *systemLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, peopleLabel.frame.origin.y + peopleLabel.frame.size.height + 20 / 667.0 * HEIGHT, WIDTH - 20, 20)];
    systemLabel.text = @"使用系统: 建议iOS 8.0以上版本";
    [self.view addSubview:systemLabel];
    [systemLabel release];
    
    UILabel *emailLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, systemLabel.frame.origin.y + systemLabel.frame.size.height + 20 / 667.0 * HEIGHT, WIDTH - 20, 20)];
    emailLabel.text = @"意见邮箱: 839335088@qq.com";
    [self.view addSubview:emailLabel];
    [emailLabel release];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
